﻿@using ZoomLa.BLL
@model ZoomLa.Model.M_ClassRoom
@{
    string schName = ViewBag.schName as string;
    B_User buser = new B_User();
}
@section head{
    <title>班级浏览</title>
}
@functions{
    public string GetIcon(string classicon)
    {
        classicon = string.IsNullOrEmpty(classicon) ? "/UploadFiles/nopic.gif" : classicon;
        if (classicon.Contains("/") || string.IsNullOrEmpty(classicon))//判断是否为路径
        { return "<img src='" + classicon + "' onerror=\"shownopic(this);\" style='width:30px; height:30px;' />"; }
        return "<span class='" + classicon + "'></span>";
    }
    public string GetStar(int star)
    {
        string result = "";
        int score = star;
        for (int i = 0; i < score; i++)
        {
            result += "<i class='staricon fa fa-star'></i>";
        }
        for (int i = 0; i < 5 - score; i++)
        {
            result += "<i class='staricon fa fa-star-o'></i>";
        }
        return result;
    }
}
@section content{
    <div id="BreadDiv" class="container-fluid mysite">
        <div class="row">
            <ol class="breadcrumb navbar-fixed-top">
                <li><a href='@(CustomerPageAction.customPath2)Main.aspx'>工作台</a></li>
                <li><a href='@(CustomerPageAction.customPath2)User/UserManage.aspx'>会员管理</a></li>
                <li><a href='SchoolManage'>学校信息配置</a></li>
                <li><a href='ClassRoomManage'>班级管理</a></li>
                <li class='active'>班级浏览</li>
            </ol>
        </div>
    </div>
    <table class="table table-striped table-bordered table-hover">
        <tr>
            <td class="td_m text-right">班级名称:</td>
            <td>@Model.RoomName</td>
        </tr>
        <tr>
            <td class="text-right">班标:</td>
            <td>@MvcHtmlString.Create(GetIcon(Model.Monitor))</td>
        </tr>
        <tr>
            <td class="text-right">所属学校:</td>
            <td>@if (!string.IsNullOrEmpty(schName))
            { <a href='SchoolShow?id=@Model.SchoolID'>@schName</a> }</td>
        </tr>
        <tr>
            <td class="text-right">班级年级:</td>
            <td>@B_GradeOption.GetGradeOption(Model.Grade).GradeName</td>
        </tr>
        <tr>
            <td class="text-right">班主任:</td>
            <td>@buser.SelReturnModel(Model.CreateUser).UserName</td>
        </tr>
        <tr>
            <td class="text-right">是否毕业:</td>
            <td>@MvcHtmlString.Create(Model.IsDone == 1 ? "<span class='fa fa-check'></span>" : "<span class='fa fa-remove'></span>")</td>
        </tr>
        <tr>
            <td class="text-right">班级星级:</td>
            <td>@MvcHtmlString.Create(GetStar(Model.ClassStar))</td>
        </tr>
        <tr>
            <td class="text-right">建立时间:</td>
            <td>@Model.Creation.ToString("yyyy-MM-dd HH:mm")</td>
        </tr>
        <tr>
            <td class="text-right">班级信息:</td>
            <td>@Model.Classinfo</td>
        </tr>
    </table>
    <div class="text-center">
        <a href="AddClassRoom?id=@Request.QueryString["ID"]" class="btn btn-primary">重新修改</a>
        <a href="ClassRoomManage" class="btn btn-primary">返回列表</a>
    </div>
}
@section script{

}